<?php
namespace Home\Controller;
use Admin\Model\NewscateModel;
use Admin\Model\NewsModel;
use Common\Model\CommonModel;
use Think\Controller;

class AboutController extends Controller{

    Public function index(){


    $this->display();



    }

    public function culture(){




        $this->display();
    }


    public function honor(){

        $this->display();

    }


    //集团新闻
    public function news(){

        $newsModel=new NewsModel();
        $newscateModel=new NewscateModel();
        $data1['name']='集团新闻';
        $news_cate=$newscateModel->where($data1)->find()['id'];
        if(!empty($news_cate)){
            $arrNews=$newsModel->where('news_cate='.$news_cate)->field('title,abstract,layout as pic,create')->limit(8)->select();
            $arrNews=CommonModel::photo1($arrNews);
            foreach($arrNews as $key=>$value){
                $arrNews[$key]['day']=date('d',$value['create']);
                $arrNews[$key]['month']=date('Y-m',$value['create']);
            }
            $this->assign('arrNews',$arrNews);
        }

        $this->display();
    }
   //最新公告
    public function news1(){

        $newsModel=new NewsModel();
        $newscateModel=new NewscateModel();
        $data1['name']='最新公告';
        $news_cate=$newscateModel->where($data1)->find()['id'];
        if(!empty($news_cate)){
            $arrNews=$newsModel->where('news_cate='.$news_cate)->field('title,abstract,layout as pic,create')->limit(8)->select();
            $arrNews=CommonModel::photo1($arrNews);
            foreach($arrNews as $key=>$value){
                $arrNews[$key]['day']=date('d',$value['create']);
                $arrNews[$key]['month']=date('Y-m',$value['create']);
            }
            $this->assign('arrNews',$arrNews);
        }

        $this->display();
    }

    //员工风采
    public function news2(){

        $newsModel=new NewsModel();
        $newscateModel=new NewscateModel();
        $data1['name']='员工风采';
        $news_cate=$newscateModel->where($data1)->find()['id'];
        if(!empty($news_cate)){
            $arrNews=$newsModel->where('news_cate='.$news_cate)->field('title,abstract,layout as pic,create')->limit(8)->select();
            $arrNews=CommonModel::photo1($arrNews);
            foreach($arrNews as $key=>$value){
                $arrNews[$key]['day']=date('d',$value['create']);
                $arrNews[$key]['month']=date('Y-m',$value['create']);
            }
            $this->assign('arrNews',$arrNews);
        }

        $this->display();
    }


    public function classroom(){

        $this->display();

    }

    public function newsDetail(){
        $this->display();

    }


}